import { createApp } from "vue";

import App from "./App.vue";
import router from "./router";
import store from "./store";

import "vfonts/Lato.css"; // 通用字体
import "vfonts/FiraCode.css"; // 等宽字体

import {
  // create naive ui
  create,
  // component
  NButton,
  NLayoutContent,
  NLayout,
  NLayoutHeader,
  NLayoutFooter,
  NCard,
  NMenu,
  NSpace,
  NGrid,
  NGridItem,
  NTime,
  NDivider,
  NH1,
  NText,
  NTag,
  NA,
  NForm,
  NFormItem,
  NFormItemGi,
  NInput,
  NDynamicTags,
  NDatePicker,
  NMessageProvider,
  NDialogProvider,
  NEmpty,
  NBlockquote,
  NPagination,
  NStatistic,
  NNumberAnimation,
  NEllipsis,
  NAvatar,
} from "naive-ui";

const naive = create({
  components: [
    NButton,
    NLayoutContent,
    NLayout,
    NLayoutHeader,
    NLayoutFooter,
    NCard,
    NMenu,
    NSpace,
    NGrid,
    NGridItem,
    NTime,
    NDivider,
    NH1,
    NText,
    NTag,
    NA,
    NForm,
    NFormItem,
    NFormItemGi,
    NInput,
    NDynamicTags,
    NDatePicker,
    NMessageProvider,
    NDialogProvider,
    NEmpty,
    NBlockquote,
    NPagination,
    NStatistic,
    NNumberAnimation,
    NEllipsis,
    NAvatar,
  ],
});
import VueMarkdownEditor from "@kangc/v-md-editor";
import VMdPreview from "@kangc/v-md-editor/lib/preview";
import "@kangc/v-md-editor/lib/style/base-editor.css";
import vuepressTheme from "@kangc/v-md-editor/lib/theme/vuepress.js";
import "@kangc/v-md-editor/lib/theme/style/vuepress.css";
import createTodoListPlugin from "@kangc/v-md-editor/lib/plugins/todo-list/index";
import "@kangc/v-md-editor/lib/plugins/todo-list/todo-list.css";
import Prism from "prismjs";
// import createKatexPlugin from "@kangc/v-md-editor/lib/plugins/katex/cdn";
import createLineNumbertPlugin from "@kangc/v-md-editor/lib/plugins/line-number/index";
// import createMermaidPlugin from "@kangc/v-md-editor/lib/plugins/mermaid/cdn";
import "@kangc/v-md-editor/lib/plugins/mermaid/mermaid.css";
// import axios from "axios";

VueMarkdownEditor.use(vuepressTheme, {
  Prism,
});
VueMarkdownEditor.use(createTodoListPlugin());
VueMarkdownEditor.use(createLineNumbertPlugin());
// VueMarkdownEditor.use(createKatexPlugin());
// VueMarkdownEditor.use(createMermaidPlugin());
VMdPreview.use(vuepressTheme, {
  Prism,
});
VMdPreview.use(createTodoListPlugin());
VMdPreview.use(createLineNumbertPlugin());
// VMdPreview.use(createKatexPlugin());
// VMdPreview.use(createMermaidPlugin());
// axios.defaults.headers.common["Authorization"] = localStorage.getItem("access")
//   ? `Bearer ${localStorage.getItem("access")}`
//   : null;
createApp(App)
  .use(store)
  .use(router)
  .use(naive)
  .use(VueMarkdownEditor)
  .use(VMdPreview)
  .mount("#app");
